package cs.rsa.ts14.juliet;

import org.hamcrest.Matchers;
import org.junit.*;
import cs.rsa.ts14.alpha.InitialState;
import cs.rsa.ts14.kilo.WeekOverviewBuilder;
import cs.rsa.ts14.lima.TransportOverviewReportBuilder;
import cs.rsa.ts14.manual.Timesag2;

public class IntegrationTestBottomUpDriver2 {
	
	private Timesag2 timesag;
	
	@Test
	public void testWeekOverview() {
		timesag = new Timesag2(new WeekOverviewBuilder(), 
							   new StandardLineTypeClassifierStrategy(),
				               new InitialState());
		timesag.handleFile("resource/timesag.txt");
		String report = timesag.getReport(); 
		Assert.assertThat(report, Matchers.containsString("=== Week Overview ==="));
	}
	
	@Test
	public void testCategoryOverview() {
		timesag = new Timesag2(new CategoryOverviewBuilder(new StandardCategoryConstructor()), 
				   			   new StandardLineTypeClassifierStrategy(),
	                           new InitialState());
		timesag.handleFile("resource/timesag.txt");
		String report = timesag.getReport(); 
		Assert.assertThat(report, Matchers.containsString("-- Time spent on classes and categories --"));
	}
	
	@Test
	public void testTransportOverview() {
		timesag = new Timesag2(new TransportOverviewReportBuilder(), 
				   new StandardLineTypeClassifierStrategy(),
	               new InitialState());
		timesag.handleFile("resource/timesag.txt");
		String report = timesag.getReport(); 
		Assert.assertThat(report, Matchers.containsString("TRANSPORT OVERVIEW REPORT"));
	}
}
